/**
 * Created by 郑益贤 on 2017/9/18.
 */
angular.module('common.auth', [
        'ui.router',
        'ngStorage',
        'module.auth',
    ])
    .run(
        ['$rootScope', '$state', '$stateParams', '$localStorage', function ($rootScope, $state, $stateParams, $localStorage) {
            $rootScope.$state = $state;
            $rootScope.$stateParams = $stateParams;
            $localStorage[environmental + "shopid"] = null; // 默认清空登录数据
        }])

    .config(
        ['$stateProvider', '$urlRouterProvider', '$locationProvider', '$httpProvider',
            function ($stateProvider, $urlRouterProvider, $locationProvider, $httpProvider) {
                $urlRouterProvider.otherwise('/login');
                $locationProvider.html5Mode(html5mode);
                $httpProvider.defaults.withCredentials = true;
            }
        ]);